home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / hp10x / flexlm.z / flexlm / FLEXlm / start_dsmld < prev    next >
Text File  |  1998-06-30  |  2KB  |  70 lines

  1. #!/bin/sh
  2. #
  3. # Script: start_dsmld
  4. #
  5. # This script will start enlighten license daemon dsmld using the license file
  6. # license.dat
  7. #
  8. # Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
  9. #
  10.  
  11. app_name="start_dsmld"
  12.  
  13. emd_dir=`egrep "^emd_dir=" /etc/enlighten | cut "-d=" -f2-`
  14. if [ -z "$emd_dir" -o ! -d "$emd_dir" ] ; then
  15.     echo "$app_name: Could not find the EMD directory." 1>&2
  16.     echo "$app_name: Unable to start license daemons." 1>&2
  17.     exit 1
  18. fi
  19.  
  20. flex_dir="${emd_dir}/FLEXlm"
  21. lmgrd="${flex_dir}/lmgrd"
  22.  
  23. if [ ! -x $lmgrd ] ; then
  24.     echo "$app_name: Unable to find $lmgrd." 1>&2
  25.     echo "$app_name: Unable to start license daemons." 1>&2
  26.     exit 1
  27. fi
  28.  
  29. lic_file="${flex_dir}/license.dat"
  30. if [ ! -f $lic_file ] ; then
  31.     echo "$app_name: Unable to find $lic_file." 1>&2
  32.     echo "$app_name: Unable to start license daemons." 1>&2
  33.     exit 1
  34. fi
  35.  
  36. log_file="${flex_dir}/lmgrd.log"
  37.  
  38. #
  39. # Start  the license daemons
  40. #
  41.  
  42. if [ ! -x ${flex_dir}/lmutil ] ; then
  43.     echo "$app_name: Unable to verify if license daemons are running." 1>&2
  44. else
  45.     # See if daemons are already up
  46.     lmgrdstat=`$flex_dir/lmutil lmstat -c $lic_file | egrep ": license server" | awk '{print $4}'`
  47.  
  48.     # If lmgrd is not running, start it up
  49.     if [ "$lmgrdstat" != UP ] ; then
  50.         $lmgrd -c $lic_file -l $log_file
  51.     else
  52.         # Issue a reread
  53.         ${flex_dir}/lmutil lmreread -c $lic_file
  54.     fi
  55.  
  56.     sleep 3
  57.  
  58.     lmgrdstat=`$flex_dir/lmutil lmstat -c $lic_file | egrep ": license server" | awk '{print $4}'`
  59.     dsmldstat=`$flex_dir/lmutil lmstat -c $lic_file | egrep "^ *$dsmld" | awk '{print $2}'`
  60.     
  61.     if [ "$lmgrdstat" != "UP" -a "$dsmldstat" != "UP" ] ;  then
  62.         echo "$app_name: License daemons failed to start."  1>&2
  63.         echo "$app_name: See $log_file for details."  1>&2
  64.         exit 1
  65.     fi    
  66. fi
  67.  
  68. exit 0
  69.  
  70.